package com.sanploy.server.retrofit;

import com.sanploy.server.retrofit.pojo.NewsResp;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/6/20.
 */
public class RetrofitUtil {
    private static final Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("http://fed.sanploy.cn:8099")
            .build();
    public static String sendGet(String url,Map<String,String> map) throws IOException {
        WechatServer wechatServer = retrofit.create(WechatServer.class);
        Call<ResponseBody> stringCall = wechatServer.listRepos();
        Response<ResponseBody> response = stringCall.execute();
        if (!response.isSuccessful()) System.out.println("不成功");
        System.out.println(response.body().string());
//        System.out.println(response.body().getList().size());
        return response.body().string();
    }
}
